package com.itheima.interceptor;

import com.itheima.domain.UmsAdmin;

// 线程内存储 admin对象
public class AdminHolder {

    private static final ThreadLocal<UmsAdmin> TLADMIN = new ThreadLocal<>();

    //绑定
    public static void set(UmsAdmin umsAdmin){
        TLADMIN.set(umsAdmin);
    }

    //获取
    public static UmsAdmin get(){
        return TLADMIN.get();
    }

    //解绑
    public static void remove(){
        TLADMIN.remove();
    }

}
